package com.tsingteng.cosfun.utils;

import com.tsingteng.cosfun.helper.VideoHelper;


public class VideoDeleteCommand extends Command {

    public int index;
    public long videoTime;
    public String videoPath;

    public VideoDeleteCommand(int index, long videoTime, String videoPath) {
        this.index = index;
        this.videoTime = videoTime;
        this.videoPath = videoPath;
    }


    @Override
    public boolean apply() {
        if (index >= 0) {
            return VideoHelper.getIntence().removeVideoInfo(index);
        }
        return false;

    }

    @Override
    public boolean unapply() {
        if (index >= 0) {
            return VideoHelper.getIntence().addVideoInfo(videoPath, videoTime, index);
        }
        return false;
    }
}
